import { request } from "@/utils/request";

// 收款信息  新增-修改（判断后台已做好）
export const collectionUpdate = (data: any = {}) => {
  return request({
    url: "/introducer/update",
    method: "POST",
    data,
  });
}

// 收款信息  查询
export const collectionInfo = (data: any = {}) => {
  return request({
    url: "/introducer/info",
    method: "POST",
    data,
  });
}
// 关注
export const apiAddFollow = (data: any = {}) => {
  return request({
    url: "/follow/addFollow",
    method: "POST",
    data,
  });
}

export const apiMyList = (data: any = {}) => {
  return request({
    url: "/commodity/myList",
    method: "POST",
    data,
  });
}

// ocr获取token  http://localhost:8080/leshi/getAccessToken
export const getAccessToken = (data: any = {}) => {
  return request({
    url: "/getAccessToken",
    method: "POST",
    data,
  });
}

// 实名认证查询 http://localhost:8080/leshi/card/info

export const getCardInfo = (data: any = {}) => {
  return request({
    url: "/card/info",
    method: "POST",
    data,
  });
}



export const getidCardOCR = (data: any = {}) => {
  return request({
    url: `https://api.weixin.qq.com/cv/ocr/idcard?type=${data.type}&img_url=${data.img_url}&access_token=${data.access_token}`,
    method: "POST",
  });
}

// 增加认证 http://localhost:8080/leshi/card/add
export const getCardAdd = (data: any = {}) => {
  return request({
    url: "/card/add",
    method: "POST",
    data,
  });
}

// 修改认证 http://localhost:8080/leshi/card/edit

export const getCardEdit = (data: any = {}) => {
  return request({
    url: "/card/edit",
    method: "POST",
    data,
  });
}

// http://localhost:8080/leshi/ocrCard

export const getOcrCard = (data: any = {}) => {
  return request({
    url: "/ocrCard",
    method: "POST",
    data,
  });
}